package com.chainwintel.prjmgmt.model;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
public class MenuCategory {
	
	private long id;
	
	private String name;
	
	private MenuCategory parentCategory;
	
	private Set<MenuCategory> childCategories;
	
//	private Set<MenuItem> menus;

	@Id @GeneratedValue
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@ManyToOne(cascade = CascadeType.ALL)
	public MenuCategory getParentCategory() {
		return parentCategory;
	}

	public void setParentCategory(MenuCategory parentCategory) {
		this.parentCategory = parentCategory;
	}

	@OneToMany(mappedBy = "parentCategory")
	public Set<MenuCategory> getChildCategories() {
		return childCategories;
	}

	public void setChildCategories(Set<MenuCategory> childCategories) {
		this.childCategories = childCategories;
	}

//	@OneToMany(mappedBy = "category")
//	public Set<MenuItem> getMenus() {
//		return menus;
//	}
//
//	public void setMenus(Set<MenuItem> menus) {
//		this.menus = menus;
//	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	
	

}
